package com.yanboo.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @description /
* @author fdq
* @date 2023-11-23
**/
@Entity
@Data
@Table(name="code_column_config")
public class CodeColumnConfig implements Serializable {

    @Id
    @Column(name = "`column_id`")
    @ApiModelProperty(value = "columnId")
    private unknowType columnId;

    @Column(name = "`column_name`")
    @ApiModelProperty(value = "columnName")
    private String columnName;

    @Column(name = "`column_type`")
    @ApiModelProperty(value = "columnType")
    private String columnType;

    @Column(name = "`date_annotation`")
    @ApiModelProperty(value = "dateAnnotation")
    private String dateAnnotation;

    @Column(name = "`dict_name`")
    @ApiModelProperty(value = "dictName")
    private String dictName;

    @Column(name = "`extra`")
    @ApiModelProperty(value = "extra")
    private String extra;

    @Column(name = "`form_show`")
    @ApiModelProperty(value = "formShow")
    private unknowType formShow;

    @Column(name = "`form_type`")
    @ApiModelProperty(value = "formType")
    private String formType;

    @Column(name = "`key_type`")
    @ApiModelProperty(value = "keyType")
    private String keyType;

    @Column(name = "`list_show`")
    @ApiModelProperty(value = "listShow")
    private unknowType listShow;

    @Column(name = "`not_null`")
    @ApiModelProperty(value = "notNull")
    private unknowType notNull;

    @Column(name = "`query_type`")
    @ApiModelProperty(value = "queryType")
    private String queryType;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "remark")
    private String remark;

    @Column(name = "`table_name`")
    @ApiModelProperty(value = "tableName")
    private String tableName;

    public void copy(CodeColumnConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
